<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="u" uri="/WEB-INF/tld/unit.tld" %>

<script type="text/javascript">
	function cancel(orderId) {
		$.ajax({
			url:"${basePath}/core/cancel.htm?orderId="+orderId,
			dataType:"json",
			success:function(data) {
				$.jqalert(data.msg, "提示");
			}
		});
	}
	
	function back() {
		$(".main").load("${basePath}/trade/cancel_list.htm");
	}
</script>
<div class="cont">
    <h2 class="title">商品信息：</h2>
    <div class="ui">
        <table class="table_list">
            <tr class="">
              <th class="">序号</th>
              <th>品名</th>
              <th class="">二维码</th>
              <th class="">年份</th>
              <th class="">批次</th>
              <th class="">类型</th>
              <th class="">价格（元）</th>
              <th class="">折扣</th>
              <th class="">折后价</th>
            </tr>
            <c:forEach items="${detail.products }" var="product" varStatus="status">
            <tr class="">
              <td class="">${status.index+1 }</td>
              <td class="">${product.product_name }</td>
              <td class="">${product.code }</td>
              <td class="">${product.productionyear }</td>
              <td class="">${product.batch }</td>
              <td class="">${product.myunit }</td>
              <td class="">${product.org_price }</td>
              <td class="">${product.discount }</td>
              <td class="">${product.now_price }</td>
            </tr>
            </c:forEach>
        </table>
    </div>
    <%-- <h2 class="title">寄存的商品：</h2>
    <div class="ui">
        <table class="table_list">
            <tr class="">
              <th class="">序号</th>
              <th>品名</th>
              <th class="">二维码</th>
              <th class="">年份</th>
              <th class="">批次</th>
              <th class="">类型</th>
              <th class="">价格（元）</th>
              <th class="">折扣</th>
              <th class="">折后价</th>
            </tr>
            <c:forEach items="${detail.saves }" var="save" varStatus="status">
            <tr class="">
              <td class="">${status.index+1 }</td>
              <td class="">${save.product_name }</td>
              <td class="">${save.code }</td>
              <td class="">${save.productionyear }</td>
              <td class="">${save.batch }</td>
              <td class="">${save.unit eq '箱'?'整装':'散装' }</td>
              <td class="">${save.org_price }</td>
              <td class="">${save.discount }</td>
              <td class="">${save.now_price }</td>
            </tr>
            </c:forEach>
        </table>
    </div> --%>
    
    <h2 class="title">结账信息：</h2>
	<div class="b_div">
		<p class="clearfix">
			<span class="info_s fl">现金支付：${detail.order.cash_amount }元</span>
			<span class="info_s fl">银行刷卡：${detail.order.bank_amount }元</span>
			<span class="info_s fl">流水号：${detail.order.serial_no }</span>
		</p>
		<p class="clearfix">
			<span class="info_s fl">会员刷卡：${detail.order.vip_amount }元</span>
			<span class="info_s fl">抹零：${detail.order.wipe_amount }元</span>
		</p>
		<p class="clearfix">
			<span class="info_s fl">应收金额：${detail.order.sum_amount }元</span>
			<span class="info_s fl">实收金额：${detail.order.pay_amount }元</span>
		</p>
		<p class="clearfix">
			<span class="info_s fl">卡号${detail.order.vip_no }</span>
		</p>
	</div>
    
    <h2 class="title">客户信息：</h2>
	<div class="b_div">
		<p class="clearfix">
			<span class="info_s fl">客户名称：${detail.customer.name }</span>
			<span class="info_s fl">联系电话：${detail.customer.tel }</span></span>
			<span class="info_s fl">传真：${detail.customer.fax }</span>
			<span class="info_s fl">邮箱：${detail.customer.email }</span>
		</p>
		<p class="clearfix">
			<span class="info_s fl">公司地址：${detail.customer.comaddress }</span>
		</p>
		<p class="clearfix">
			<span class="info_s fl">送货地址：${detail.customer.address }</span>
		</p>
	</div>
	
	<div class="text_c">
      	<a href="javascript:;" class="yellow_btn btn" onclick='cancel("${detail.order.id}");'>确认撤销</a>
      	&nbsp;&nbsp;
      	<a href="javascript:;" onclick="back();">返回</a>
    </div>

